#include <stdio.h>
struct student{
	char name[10];
	int a,b,c;
	
};
int main()
{
	int sum=0,t,max=0,k;
	double ave;
	struct student p[3];
	for(int i=0;i<3;i++){
		scanf("%s%d%d%d",&p[i].name,&p[i].a,&p[i].b,&p[i].c);
		t=p[i].a+p[i].b+p[i].c;
		sum+=t;
		if(t>max){
			max=t;
			k=i;
		}
	}
	ave=sum*1.0/9;
	printf("%.2lf\n",ave);
	printf("%s %d %d %d",p[k].name,p[k].a,p[k].b,p[k].c);

	
	
	return 0;
 } 
